package com.qn.wechat.service;

import com.jeesuite.common2.sequence.SnowflakeGenerator;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class IdService {

    @Value("${idGeneratorSnowflake-ProcessId}")
    private long processId;

    public long genId() {
        SnowflakeGenerator sf = new SnowflakeGenerator(processId, 1);
        return sf.nextId();

    }

}
